package com.we.connect.weconnect.router.system;

import com.we.connect.weconnect.model.system.SysUser;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class SysUserRouter {

    @GetMapping("/")
    public String processLoginPage() {
        return "redirect:/login";
    }

    @GetMapping("/login")
    public String showLoginPage(Model model) {
        SysUser sysUser = new SysUser();
        model.addAttribute("sysUser", sysUser);
        return "system/login";
    }

    @GetMapping("/register")
    public String showRegisterPage(Model model) {
        SysUser sysUser = new SysUser();
        model.addAttribute("sysUser", sysUser);
        return "system/register";
    }
}
